/*
 * RenewItemsStrutsAction.java
 *
 * Created on July 8, 2007, 3:19 AM
 */

package com.abbh.libcommunity.struts.actions;

import com.abbh.libcommunity.model.UserRentedItems;
import com.abbh.libcommunity.struts.beans.RenewItemsStrutsActionForm;
import com.abbh.libcommunity.dao.LCHibernateUtil;
import com.abbh.libcommunity.bo.impl.ItemRentBOImpl;
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oracle.sql.DATE;


import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
/**
 *
 * @author Atef A. Ahmed
 * @version
 */

public class RenewItemsStrutsAction extends Action {
    
    /* forward name="success" path="" */
    private final static String SUCCESS = "success";

    private RenewItemsStrutsActionForm from;
    
    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param form The optional ActionForm bean for this request.
     * @param request The HTTP Request we are processing.
     * @param response The HTTP Response we are processing.
     * @throws java.lang.Exception
     * @return
     */
    public ActionForward execute(ActionMapping mapping, ActionForm  form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        RenewItemsStrutsActionForm r=(RenewItemsStrutsActionForm)from;
        
     
   
        UserRentedItems ri = new UserRentedItems();
        ri.getItem();
        
        ItemRentBOImpl y = new ItemRentBOImpl();
        y.findByItemId(r.getItemId());
        UserRentedItems a = y.findByItemId(r.getItemId());        
       
        
       // Calendar.set(Calendar.DAY_OF_MONTH, Date date);
        
     
      
         
         
     //Date a1=   a.getDueDate();
        
        
   //     ItemRentBOImpl renew = new ItemRentBOImpl();
     //   renew.renewItem(ri);
        
        return mapping.findForward(SUCCESS);
        
    }
}
